package com.spotbook.ui;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.NavUtils;
import android.view.MenuItem;

import com.spotbook.R;

public class SpotDetailActivity extends FragmentActivity {
	SpotDetailFragment details;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_spot_detail);

		getActionBar().setDisplayHomeAsUpEnabled(true);
		this.details = (SpotDetailFragment) getSupportFragmentManager()
				.findFragmentById(android.R.id.content);
		this.details.setData(getIntent().getData());
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		if (item.getItemId() == android.R.id.home) {
			NavUtils.navigateUpTo(this,
					new Intent(this, SpotListActivity.class));
			return true;
		}

		return super.onOptionsItemSelected(item);
	}
}
